<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simSetObjectParent</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simSetObjectParent" id="simSetObjectParent"></a>simSetObjectParent / sim.setObjectParent</h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Sets an object's parent object. See also <a href="simGetObjectParent.htm">sim.getObjectParent</a>.<br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simSetObjectParent(simInt objectHandle,simInt parentObjectHandle,simBool keepInPlace)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>objectHandle</strong>: handle of the object that will become child of the parent object. Can be combined with <a href="../apiConstants.htm#specialHandleFlags">sim_handleflag_assembly</a> (simply add sim_handleflag_assembly to <strong>objectHandle</strong>), if the two objects can be assembled via a predefined assembly transformation (refer to the <strong>assembling</strong> option in the <a href="../commonPropertiesDialog.htm">object common properties</a>). In that case, <strong>parentObjectHandle</strong> can't be -1, and <strong>keepInPlace</strong> should be set to false.</div>
<div><strong>parentObjectHandle</strong>: handle of the object that will become parent, or -1 if the object should become parentless.</div>
<div><strong>keepInPlace</strong>: indicates whether the object's absolute position and orientation should stay same</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>sim.setObjectParent(int objectHandle,int parentObjectHandle,boolean keepInPlace)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>none</div></td> 
</tr> 

<tr class=apiTableTr> 
<td class=remApiTableLeftCParam>
Remote API equiv.
</td> 
<td class=remApiTableRightCParam>
<div>B0-based remote API: <a href="../b0RemoteApi-cpp.htm#simxSetObjectParent">simxSetObjectParent</a></div>
<div>Legacy remote API: <a href="../remoteApiFunctions.htm#simxSetObjectParent">simxSetObjectParent</a></div>
</td> 
</tr> 

</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
